<?php 
use \PsiFramework\Classes\Util\UI\Printer;
use \PsiFramework\Classes\Util\UI\HTML;

$note = $templateManager->getParameter('note');
if (is_null($note)) {
    $note = 0 ;
}

$entries = $templateManager->getParameter('entries');
?>
<!DOCTYPE html>
<html lang="fr-FR">
    <head>
        <meta charset="utf-8">
        <title>Portail Allo-media - <?php Printer::display($languageManager->getText($templateManager->getTitle())); ?>
        </title>
        
        <!-- meta -->
        <meta name="description" content="AlloMedia">
        <meta name="author" content="Rémi San">
        
        <!-- Scripts -->
        <?php
        foreach ($templateManager->getRemoteScripts() as $remote) {
        ?>
        <script
            type="text/javascript"
            src="<?php Printer::display($remote); ?>"></script>
        <?php
        }
        if ($templateManager->hasScriptFiles()) { ?>
        <script
            type="text/javascript"
            src="Scripts/scripts.php?file=<?php Printer::display($templateManager->getScriptFileList()); ?>"></script>
        <?php
        }
        if ($templateManager->hasScripts()) { ?>
        <script type="text/javascript">
            <?php echo $templateManager->getScriptList(); ?>
        </script>
        <?php
        }
        ?>
        
        <!-- Styles -->
        <?php
        foreach ($templateManager->getRemoteStyles() as $remote) {
        ?>
        <link
            rel="stylesheet"
            type="text/css"
            href="<?php Printer::display($remote); ?>"
            media="screen" />
        <?php
        }
        //TODO passer le css dans les actions
        $css  = 'Applications/AlloMediaPortal/Template/styles/jquery.css,';
        $css .= 'Applications/AlloMediaUser/Template/styles/global.css,';
        $css .= 'Applications/AlloMediaUser/Template/styles/form.css,';
        $css .= 'Applications/AlloMediaUser/Template/styles/accueil.css,';
        ?>
        <link
            rel="stylesheet"
            type="text/css"
            href="Styles/styles.php?file=<?php Printer::display($css.$templateManager->getStyleFileList()); ?>"
            media="screen" />
        <?php
        if ($templateManager->hasStyles()) {
        ?>
        <style type="text/css" media="screen">
            <?php echo $templateManager->getStyleList(); ?>
        </style>
        <?php
        }
        ?>

        <link rel="shortcut icon" href="./Images/AlloMedia/allomedia.ico">

        <!--[if lt IE 9]><script src="./Scripts/html5.js"></script><![endif]-->
    	<!--[if lt IE 8]><link rel="stylesheet" href="./Styles/ie7.css"><![endif]-->
    	<!--[if lt IE 7]><div style='border:1px solid #F7941D;background:#FEEFDA;text-align:center;clear:both;height:85px;position:relative;'><div style='position:absolute;right:3px;top:3px;font-family:courier new;font-weight:bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none";return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border:none;' alt='Close this notice'/></a></div><div style='width:640px;margin:0 auto;text-align:left;padding:0;overflow:hidden;color:black;'><div style='width:75px;float:left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div><div style='width:275px;float:left;font-family:Arial, sans-serif;'><div style='font-size:14px;font-weight:bold;margin-top:12px;'>Vous utilisez un navigateur dépassé depuis près de 8 ans !</div><div style='font-size:12px;margin-top:6px;line-height:12px;'>Pour une meilleure expérience web, prenez le temps de mettre à jour votre navigateur.</div></div><div style='width:75px;float:left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border:none;' alt='Get Firefox 3.5'/></a></div><div style='width:75px;float:left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border:none;' alt='Get Internet Explorer 8'/></a></div><div style='width:73px;float:left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border:none;' alt='Get Safari 4'/></a></div><div style='float:left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border:none;' alt='Get Google Chrome'/></a></div></div></div><![endif]-->
    </head>
    <body class="site">
        <div id="page">
            <div id="conteneur">
                <section id="bandeau">
                    <div class="contenu">
                        <a class="logo" href="<?php Printer::display(HTML::linkHref('')); ?>">
                            <span></span>
                        </a>
                        <div class="ban"></div>
                    </div>
                </section>
                <?php $templateManager->displayTemplate('TopMenu');  ?>
                <section id="corps">
                    <div class="contenu">
                        <?php $templateManager->displayTemplate('WelcomeBanner');  ?>
                        <?php $templateManager->displayTemplate('main');  ?>
                        <?php $templateManager->displayTemplate('LeftMenu');  ?>
                    </div>
                </section>
                <?php $templateManager->displayTemplate('BottomMenu');  ?>
            </div>
        </div>
        <!-- Trace -->
        <?php $templateManager->displayTemplate('Trace');  ?>
        <!-- First visit -->
        <?php $templateManager->displayTemplate('FirstVisit');  ?>
        <!-- boxshadow -->
		<div id="boxshadow-confirmation" class="fenetreXt"></div>
		<div id="boxshadow-alerte" class="fenetreXt"><?php $templateManager->displayTemplate('PaymentAlert');  ?></div>
        <?php $templateManager->displayTemplate('Debug', $response);  ?>
        <script type="text/javascript">
        	$(document).ready(function(){
        
        		// Menu top fixed
        		var menu = $('#entete'), pos = menu.offset(); $(window).scroll(function(){
        			if($(this).scrollTop() > pos.top && menu.hasClass('default')){
        				menu.removeClass('default').addClass('fixed');
        			} 
        			else if($(this).scrollTop() <= pos.top && menu.hasClass('fixed')){
        				menu.removeClass('fixed').addClass('default');
        			}
        		});
        	});
        </script>
    </body>
</html>
